<template>
  <div class="top-title">
    <div class="title-wrap">
      <span class="top-title-icon"></span>
      <slot></slot>
      <a-tooltip v-if="tooltip" :content="tooltip">
        <icon-question-circle class="help-icon" />
      </a-tooltip>
    </div>
    <slot name="extra"></slot>
  </div>
</template>

<script setup name="top-title">
  defineProps({
    tooltip: String,
  })
</script>

<style lang="less" scoped>
  .top-title {
    margin-top: 30px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 16px;
    color: #1d2129;
    line-height: 24px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    .title-wrap {
      display: flex;
      align-items: center;
      .top-title-icon {
        width: 5px;
        height: 19px;
        background: #1890ff;
        margin-right: 8px;
      }
    }

    .help-icon {
      margin-left: 4px;
    }
  }
</style>
